<script setup>
	import {onShow} from "@dcloudio/uni-app"
	import {provide} from 'vue'
	import { userStore } from '@/store/user.js'
	const cartStore = userStore()
	// export default {
	// 	onLaunch: function() {
	// 		console.log('App Launch')
	// 	},
	// 	onShow: function() {
	// 		console.log('App Show')
	// 	},
	// 	onHide: function() {
	// 		console.log('App Hide')
	// 	}
	// } 
	onShow(()=>{
		provide('navigateTo',(options) => {
			if (!cartStore.loginStatus) {
				uni.showToast({
					title: "请先登录",
					icon: "none"
				})
				return uni.navigateTo({
					url: "/pages/login/login"
				})
			}
			uni.redirectTo(options)
		})
	})
</script>

<style>
	/*每个页面公共css */
	@import 'common/uni.css';
	@import 'common/iconfont.css';
	@import 'common/common.css'
</style>